package com.example.mybatisplus.stock.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.mybatisplus.stock.dto.InStockDto;
import com.example.mybatisplus.stock.entity.Stock;
import com.example.mybatisplus.stock.entity.StockLog;
import com.example.mybatisplus.stock.service.impl.StockLogServiceImpl;
import com.example.mybatisplus.stock.service.impl.StockServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zwzheng
 * @since 2021-05-01
 */
@RestController
@RequestMapping("/stock/")
public class StockController {

    @Autowired
    private StockServiceImpl stockService;
    @Autowired
    private StockLogServiceImpl stockLogService;

    @RequestMapping("save")
    public void save(){
      /*  Stock stock = new Stock();
        stock.setSeqId(UUID.randomUUID().toString());
        stock.setStock(1);
        stock.setProductId("121");
        stock.setProductName("sfss");
        stock.setProductSize("44");
        stock.setCreateTime(LocalDateTime.now());
        stock.setCreateUser("zhzheng");
        stock.setUpdateTime(LocalDateTime.now());
        stock.setUpdateUser("zwzheng");
        stockService.save(stock);*/
    }

    //入库
    @PostMapping("instock")
    public void instock(InStockDto stockDto){
        stockService.instock(stockDto);
    }



}
